package com.tianya.springcloud.controller;

import com.tianya.springcloud.entities.CommonResult;
import com.tianya.springcloud.entities.Payment;
import com.tianya.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: cloud2020
 * @description
 * @author: tianya
 * @create: 2020-06-16 16:57
 **/
@RestController
@Slf4j
public class OrderFeignController {

    @Resource
    private PaymentFeignService feignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult getPaymentById(@PathVariable ("id") Long id){
        return feignService.getPaymentById(id);
    }

    @GetMapping("/consumer/payment/create")
    public CommonResult create(Payment payment){
        return feignService.create(payment);
    }
}
